#list picker
# test <- list(1, 2, 3)
# since we cannot use test[[c(2, 3)]]

list_picker <- function(
  ori_list = list(),
  pick_vec = c()
){
  order <- "out_list <- (list("
  for(i in 1:(length(pick_vec) - 1)){
    order <- paste(order, "ori_list[[", pick_vec[i], "]],", sep = "")
  }
  order <- paste(order, "ori_list[[", pick_vec[length(pick_vec)], "]]))", sep = "")
  #cat(order, "\n", sep = "")
  eval(parse(text = order))
  return(out_list)
}

####Testing Area####
# test <- list(1, 2, 3:7, c("a", "b"), "happy", 5)
# list_picker(ori_list = test, pick_vec = 3:5)
